import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {  
    path: '/',  
    redirect: '/home' // 当访问 '/' 时，重定向到 '/home'  
  }, 
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue')
  },
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
